using System.Collections.Generic;
using System.ServiceModel.Syndication;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace aprogblog.Specs.Helpers {

    public static class BehaviorAssertions {
        
        public static void ShouldBe(this object Actual, object Expected) {
            
            Assert.AreEqual(Expected, Actual);
        }
        
        public static void ShouldBeLessOrEqual(this int Actual, int Expected) {
            
            Assert.IsTrue(Actual <= Expected, Actual + " in not <= " + Expected);
        }

        public static void ShouldNotContain(this IEnumerable<SyndicationItem> ActualItems, SyndicationItem ExpectedItem) {
            var ContainsItem = false;
            
            foreach (var ActualItem in ActualItems)
                if (ActualItem.Id.Equals(ExpectedItem.Id)) 
                    ContainsItem = true;
            
            Assert.IsFalse(ContainsItem, "Should not contain Item");            
        }
    }
}